<ul class=headsup_panel>
	<li class=col1>
		<h1>search the universe</h1>
	</li>
	<li class='col2 right'>
		<form action="<?php echo $this->base ?>/subjects/search/" method="post">
			<select name="search_type" class="search_type">
				<option value="0">Subjects</option>
				<option value="1">Tags</option>
			</select>
			<input type="search" name="subject" placeholder="Type Keyword">
			<button type="submit"> &nbsp; </button>
		</form>
	</li>
</ul>

<div class=subject_panel>
	
	<ul class=sp_subject_info>
		<li class='breadings col1'>
			<ul>
				<li>Subject list</li>
				<li> &#9002; </li>
				<li><a href="#"><?php echo $userdetail['User']['username'] ?></a></li>
			</ul>
		</li>
	</ul>
	
	<div id=subjectlist>
	
		<div class='subject_profile col1'>
			
			<h2>subject creator</h2>
			
			<ul class=creator_profile>
				<li>
					<img src="<?php echo $this->webroot ?>temp/tmp_img/img_jackjung02.jpg" alt="img_jackjung02" width="165" height="165" />
                    <?php
                        $strNameDis = $userdetail['User']['username'];
                        if(strlen($strNameDis) > 9)
                        {
                            $strNameDis = substr($strNameDis, 0, 8) . '...';
                        }
//                        echo $strNameDis;
                    ?>
				</li>
			</ul>
			
			<ul class=creator_info_list>
				<li>Ranks <span blue>#<?php echo $rank['rank'] ?></span> in points</li>
				<li>level: <span blue class=large><?php echo $level ?></span></li>
				<li>has <span blue><?php echo $points ?></span> points</li>
				<li>rated <span blue><?php echo $subjects_rated ?></span> subjects </li>
				<li>added <span blue><?php echo $subject_added ?></span> subjects</li>
				<li class=smaller>Rating the universe since: <?php echo date('F d, Y', strtotime($userdetail['User']['created'])) ?></li>
			</ul>
		</div>
		
		<div class='subject_info_list col2'>
			<table>
				<thead>
					<tr>
						<td width="50%" colspan="2">subject</td>
						<td width="25%">creator's u-rating</td>
					</tr>
				</thead>
				<tbody>
                <?php
                    $currpage = $this->Paginator->current();
                    $i = ($currpage - 1) * 20 + 1;
                    foreach($data as $subject)
                    {
                        $strSubjDis = $subject['Subject']['subject'];
                        if(strlen($strSubjDis) > 30)
                        {
                            $strSubjDis = substr($strSubjDis, 0, 29) . '...';
                        }
                ?>
				    <tr>
                        
						<td width="5%"><?php echo $i ?></td>
						<td width="45%"><a href="<?php echo $this->base ?>/subjects/subject/<?php echo $subject['Subject']['id'] ?>" style="color: white;"><?php echo $strSubjDis; ?></a></td>
						<td width="25%"><?php echo number_format(round($subject[0]['avg_rating'], 1), 1); ?></td>
                        </a>
					</tr>
                <?php
                        $i++;
                    }
                ?>
				</tbody>
			</table>		
		</div>
		
		<div class=clear></div>

		<ul class=sp_subject_info style="margin-top:-20px; ">
			<li class='breadings col1'></li>
			<li class='pagination col2 right'>
                <!-- Shows the page numbers -->
                <?php echo $this->Paginator->numbers( array(
                    'currentClass' => 'current_alt',
                    'modulus' => 4,
                    'first' => 1,
                    'last' => 1                    
                )); ?>
                <!-- prints X of Y, where X is current page and Y is number of pages -->
                <?php echo $this->Paginator->counter(); ?>
			</li>
		</ul>

	</div>
	
</div>